package com.kgc.lab3;

public class MainApplication {
    public static void main(String[] args) {
        Student stu1 = new Student(1000,"张三",21);
        Student stu2 = new Student(1000,"张三",21);
        //当两个不同的对象引用它们属性值完全相同，视同一个对象??
        System.out.println("stu1.equals(stu2) >>" + (stu1.equals(stu2) ? "是同一个学生": "不是同一个学生"));
        System.out.println(stu1);



        /*System.out.println("stu1 == stu2 >> " + (stu1 == stu2)); //false
        System.out.println("stu1.equals(stu2) >> " + (stu1.equals(stu2))); //false
        Student stu3 = stu1;
        System.out.println("stu3 == stu1 >> " + (stu3 == stu1)); //true
        System.out.println("stu3.equals(stu1) >> " + (stu3.equals(stu1))); //true*/
    }
}
